﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class MessageDetail : DLL.MyWebPage
{
	private DLL.Message.Component clsMessageComp;
	private int nMessageID = 0;

	protected void Page_Load(object sender, EventArgs e)
	{
		try
		{
			nMessageID = Convert.ToInt32(Request["MessageID"]);
		}
		catch
		{
			nMessageID = 0;
		}

		if (!IsPostBack)
		{
			Show();
		}
	}

	protected override void OnInit(EventArgs e)
	{
		clsMessageComp = new DLL.Message.Component(Page);

		base.OnInit(e);
	}

	/// <summary>
	/// 显示一个留言的详细内容
	/// </summary>
	private void Show()
	{
		DLL.Message.Entity clsMessage = new DLL.Message.Entity();

		clsMessage = clsMessageComp.GetOne(nMessageID);

		LabPersonName.Text = clsMessage.PersonName;
		LabEMail.Text = clsMessage.EMail;
		LabPhone.Text = clsMessage.Phone;
		LabMessageDate.Text = clsMessage.MessageDateTime;
		LabIsAnswer.Text = clsMessage.StateName;
		LabAnswerDate.Text = clsMessage.AnswerDateTime;
		LabContent.Text = clsMessage.Content;
		LabAnswer.Text = clsMessage.Answer;
	}
}